//
//  UIDeviceMeasure.m
//  ARUI
//
//  Created by zhaoyunyi on 14-10-10.
//  Copyright (c) 2014年 zhaoyunyi. All rights reserved.
//

#import "UIDeviceMeasure1.h"

@implementation UIDeviceMeasure1

-(int)identifyResolution
{
    NSString *deviceType = [UIDevice currentDevice].model  ;
     NSLog(@"is deviceType %@",deviceType);
    if([deviceType isEqualToString:@"iPhone"]) {
        //iPhone
        NSLog(@"is iPhone");
        
        NSLog(@">>>test--%f--%f **%f**%f",ScreenWidth,iPhone4_4sWidth,ScreenHeight,iPhone4_4sHeight);
        
        if (ScreenWidth == iPhone4_4sWidth && ScreenHeight == iPhone4_4sHeight) {
            NSLog(@"is iPhone4/4s");

            return  UIDevice_iPhone4_4s;
        }
        if (ScreenWidth == iPhone5_5sWidth && ScreenHeight == iPhone5_5sHeight) {
            NSLog(@"is iPhone5_5s");

            return  UIDevice_iPhone5_5s;
        }
        if (ScreenWidth == iPhone6Width && ScreenHeight == iPhone6Height) {
            NSLog(@"is iPhone6");
            
            return  UIDevice_iPhone6;
        }
        if (ScreenWidth == iPhone6plusWidth && ScreenHeight == iPhone6plusHeight) {
            NSLog(@"is iPhone6plus");
            
            return  UIDevice_iPhone6plus;
        }
        
    }else if([deviceType isEqualToString:@"iPod touch"]) {
        //iPod Touch
        NSLog(@"is iPod Touch");
    }
    else
    {
        NSLog(@"is iPad2");
        NSLog(@"%f , %f",ScreenHeight,ScreenWidth);
        NSLog(@"Scale %f",ScreenScale);
        
        return UIDevice_iPad;
    }
    
  
    
    return 0;
}

@end
